package net.sudot.chess.business.service;

import net.sudot.chess.business.dao.GameDao;
import net.sudot.chess.business.dto.GameDetailDTO;
import net.sudot.chess.business.model.Game;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 游戏
 *
 * @author tangjialin on 2018-02-27.
 */
@Service
public class GameService extends BaseService<Game> {

    @Resource
    private GameDao gameDao;

    /**
     * 获取游戏分类下的游戏
     *
     * @param categoryId 游戏分类主键
     * @return 返回游戏信息
     */
    public List<Game> findByCategory(Long categoryId) {
        return gameDao.findByCategory(categoryId);
    }

    /**
     * 获取游戏分类下的游戏详细信息
     *
     * @param categoryId 游戏分类主键
     * @return 返回游戏详细信息
     */
    public List<GameDetailDTO> findDetailByCategory(Long categoryId) {
        return gameDao.findDetailByCategory(categoryId);
    }
}
